package GetClass;

public class toStringTest {
    public static void main(String[] args) {
        /**
         * 获得字符串的表现形式
         *
         */
        Object o = new Object();
        System.out.println(o.toString());//java.lang.Object@1b6d3586
        Fish fish = new Fish();
        Bird bird = new Bird();
        System.out.println(fish.toString());//GetClass.Fish@4554617c
        System.out.println(bird);//打印对象,实质打印的就是该对象的toString的结果 GetClass.Bird@74a14482
        System.out.println(bird.toString());//GetClass.Bird@74a14482  俩者相同
        System.out.println(bird.hashCode());//1956725890


    }
}
class Fish{}
class Bird{}